<?php /* Smarty version 2.6.16, created on 2012-07-20 10:15:12
         compiled from my_lesson.tpl */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('modifier', 'truncate', 'my_lesson.tpl', 159, false),array('modifier', 'date_format', 'my_lesson.tpl', 163, false),)), $this); ?>
<head>
<script language="javascript1.2" src="includejs/functions_admin.js" type="text/javascript"></script>
</head>
<?php echo '

<script type="text/javascript">
var j = jQuery.noConflict();
j(document).ready(function(){
		
focus_blur(\'Search_lesson_title\',\'Search by title\');
focus_blur(\'Search_from_date\',\'From\');
focus_blur(\'Search_to_date\',\'To\');
focus_blur(\'Search_from_date_in\',\'From\');
focus_blur(\'Search_to_date_in\',\'To\');
});

function LessonComplete(id){
	//window.location.href="check_lesson.php?action=complete&lesson_id="+id;
	var r=confirm("Are You Sure that lesson has been completed?");
	if (r==true)
	{
		window.location.href="my_lesson.php?action=complete&lesson_id="+id;
		return true;
	}
	else{
		return false;
	}

}

function ChangeStatus(id){

window.location.href="lesson_payment.php?lesson_id="+id;
}
function SearchLesson(formID){

	var frmID=\'#\'+formID;

	var params ={
	
		\'module\': \'contact\'
	};

	var paramsObj = j(frmID).serializeArray();

	j.each(paramsObj, function(i, field){

		params[field.name] = field.value;

	});
	
	j.ajax({
		type: "POST",
		url:  \'check_lesson.php?action=list_search&IsProcess=Y\',
		data:  params,
		dataType : \'html\',
		success: function(data){
			//alert(data);
			j(\'#show\').html(data);
        }
      });
}
</script>
'; ?>

<div id="show">
		
	  <div class="clear"></div>
<!--<div align="right"><p class="button-flex-big button90"><a href="my_lesson_update.php"><span>Add Lesson</span></a></p></div>-->
		<div class="content">
   		
				<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => 'user_tabs.tpl', 'smarty_include_vars' => array('active_tab' => 'lessons')));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
				
        <div class="clear"></div>
        <div class="tabular-content"> 
		 <div class="total-message"><strong>Total Lessons : <?php echo $this->_tpl_vars['Numcoachgame']; ?>
</strong>&nbsp;&nbsp;</div>       
		      <div class="tab_sub">
            	<ul>
                	<?php if ($this->_tpl_vars['is_coach'] == '1'): ?><li><a href="add_lesson.php"  class="active" >Add Lesson</a></li><?php endif; ?>
                    <li><a href="javascript:;">My Lesson</a></li>
                </ul>
            </div>                   
            <div class="clear"></div>    
			<div class="dashboard_area">
		   <div class="dashboard_block new-income">
		   <h2>General Search</h2>
			<form method="POST" name="form_search" id="form_search" action="my_lesson.php" onsubmit="return false;" style="padding:10px;">
			<table width="100%" border="0" cellspacing="0" cellpadding="0" class="new">
				<tr>
				  <td width="25%" align="left" valign="middle"><input size="30" type="text" name="Search_lesson_title" id="Search_lesson_title" value="<?php echo $this->_tpl_vars['Search_lesson_title']; ?>
" class="textbox search-box"/></td>
				
					<td width="75%" align="left" valign="middle" style="color:#000000; padding-left:5px;">
					Select Coach:&nbsp;
					<select name="Search_coach_id" id="Search_coach_id">
						<option value="">--Select--</option>
						<?php unset($this->_sections['Rows']);
$this->_sections['Rows']['name'] = 'Rows';
$this->_sections['Rows']['loop'] = is_array($_loop=$this->_tpl_vars['SelectCoachArr']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['Rows']['show'] = true;
$this->_sections['Rows']['max'] = $this->_sections['Rows']['loop'];
$this->_sections['Rows']['step'] = 1;
$this->_sections['Rows']['start'] = $this->_sections['Rows']['step'] > 0 ? 0 : $this->_sections['Rows']['loop']-1;
if ($this->_sections['Rows']['show']) {
    $this->_sections['Rows']['total'] = $this->_sections['Rows']['loop'];
    if ($this->_sections['Rows']['total'] == 0)
        $this->_sections['Rows']['show'] = false;
} else
    $this->_sections['Rows']['total'] = 0;
if ($this->_sections['Rows']['show']):

            for ($this->_sections['Rows']['index'] = $this->_sections['Rows']['start'], $this->_sections['Rows']['iteration'] = 1;
                 $this->_sections['Rows']['iteration'] <= $this->_sections['Rows']['total'];
                 $this->_sections['Rows']['index'] += $this->_sections['Rows']['step'], $this->_sections['Rows']['iteration']++):
$this->_sections['Rows']['rownum'] = $this->_sections['Rows']['iteration'];
$this->_sections['Rows']['index_prev'] = $this->_sections['Rows']['index'] - $this->_sections['Rows']['step'];
$this->_sections['Rows']['index_next'] = $this->_sections['Rows']['index'] + $this->_sections['Rows']['step'];
$this->_sections['Rows']['first']      = ($this->_sections['Rows']['iteration'] == 1);
$this->_sections['Rows']['last']       = ($this->_sections['Rows']['iteration'] == $this->_sections['Rows']['total']);
?>
							<option value="<?php echo $this->_tpl_vars['SelectCoachArr'][$this->_sections['Rows']['index']]['coach_id']; ?>
" <?php if ($this->_tpl_vars['SelectCoachArr'][$this->_sections['Rows']['index']]['coach_id'] == $this->_tpl_vars['Search_coach_id']): ?> selected <?php endif; ?>><?php echo $this->_tpl_vars['SelectCoachArr'][$this->_sections['Rows']['index']]['coach_name']; ?>
</option>
						<?php endfor; endif; ?>
					</select>
				  </td>
				</tr>
				<tr><td colspan="3">&nbsp;</td></tr>
				<tr>
				<td colspan="3" width="45%" align="left" valign="middle">
					<div style="float:left;">
						<input type="text" name="Search_from_date" id="Search_from_date" class="datebox" value="<?php echo $this->_tpl_vars['Search_from_date']; ?>
" style="width:80px;" readonly=""/><a href="javascript:void(0)" onclick="if(self.gfPop)gfPop.fEndPop(document.form_search.Search_from_date,document.form_search.Search_from_date);return false;" HIDEFOCUS><img class="PopcalTrigger" align="top" src="images/icon_calender.gif" border="0" alt="Click to set Date" height="17"></a>
					</div>
					<div style="float:left; padding-left:70px;">
						<input type="text" name="Search_to_date" id="Search_to_date" class="datebox" value="<?php echo $this->_tpl_vars['Search_to_date']; ?>
" style="width:80px;" readonly=""/><a href="javascript:void(0)" onclick="if(self.gfPop)gfPop.fEndPop(document.form_search.Search_from_date,document.form_search.Search_to_date);return false;" HIDEFOCUS><img class="PopcalTrigger" align="top" src="images/icon_calender.gif" border="0" alt="Click to set Date" height="17"></a></div>
				 </td>
				</tr>
				<tr><td colspan="3">&nbsp;</td></tr>
				<tr><td colspan="3" align="left" valign="middle" style="color:#000000; padding-left:5px;">
					Select Status:&nbsp;
					<select name="Search_lesson_status" id="Search_lesson_status">
						<option value="">--Select--</option>
						<?php unset($this->_sections['Rows']);
$this->_sections['Rows']['name'] = 'Rows';
$this->_sections['Rows']['loop'] = is_array($_loop=$this->_tpl_vars['SelectStatusArr']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['Rows']['show'] = true;
$this->_sections['Rows']['max'] = $this->_sections['Rows']['loop'];
$this->_sections['Rows']['step'] = 1;
$this->_sections['Rows']['start'] = $this->_sections['Rows']['step'] > 0 ? 0 : $this->_sections['Rows']['loop']-1;
if ($this->_sections['Rows']['show']) {
    $this->_sections['Rows']['total'] = $this->_sections['Rows']['loop'];
    if ($this->_sections['Rows']['total'] == 0)
        $this->_sections['Rows']['show'] = false;
} else
    $this->_sections['Rows']['total'] = 0;
if ($this->_sections['Rows']['show']):

            for ($this->_sections['Rows']['index'] = $this->_sections['Rows']['start'], $this->_sections['Rows']['iteration'] = 1;
                 $this->_sections['Rows']['iteration'] <= $this->_sections['Rows']['total'];
                 $this->_sections['Rows']['index'] += $this->_sections['Rows']['step'], $this->_sections['Rows']['iteration']++):
$this->_sections['Rows']['rownum'] = $this->_sections['Rows']['iteration'];
$this->_sections['Rows']['index_prev'] = $this->_sections['Rows']['index'] - $this->_sections['Rows']['step'];
$this->_sections['Rows']['index_next'] = $this->_sections['Rows']['index'] + $this->_sections['Rows']['step'];
$this->_sections['Rows']['first']      = ($this->_sections['Rows']['iteration'] == 1);
$this->_sections['Rows']['last']       = ($this->_sections['Rows']['iteration'] == $this->_sections['Rows']['total']);
?>
							<option value="<?php echo $this->_tpl_vars['SelectStatusArr'][$this->_sections['Rows']['index']]['lesson_status_id']; ?>
" <?php if ($this->_tpl_vars['SelectStatusArr'][$this->_sections['Rows']['index']]['lesson_status_id'] == $this->_tpl_vars['Search_lesson_status']): ?> selected <?php endif; ?>><?php echo $this->_tpl_vars['SelectStatusArr'][$this->_sections['Rows']['index']]['lesson_status_title']; ?>
</option>
						<?php endfor; endif; ?>
					</select></td>
				</tr>	
				<tr><td colspan="3">&nbsp;</td></tr>
				<tr>	
					<td valign="middle" colspan="3">
					<!--<input type="hidden" name="dosearch" value="GO">-->
					<input class="go"  name="submitdosearch" value="GO" type="button" onClick="SearchLesson('form_search')" />
					<input class="reset" name="" type="button" value="RESET" onClick="window.location.href='my_lesson.php';"/></td>
				</tr>
		  </table>
	</form>
	</div>
	<div class="clear"></div>
	  </div>                 
            <div>
            	<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabular_row tabular-data">
				<?php if ($this->_tpl_vars['Numcoachgame'] != 0): ?>
				  <tr style="border-bottom:#000000 1px solid; background:#ebebeb">
				  	<th width="10%" align="left">Title</th>
					<th width="40%" align="left">Description</th>
				  	<th width="10%" align="left">Coach</th>
					<th width="10%" align="center">Price</th>
					<th width="5%" align="center">Status</th>
					<th width="5%" align="center">Date</th>
					<th width="20%" align="center">Action</th>
				  </tr>
				  <tr>
				  	<th width="10%" align="center">&nbsp;</th>
					<th width="40%" align="center">&nbsp;</th>
				  	<th width="10%" align="center">&nbsp;</th>
					<th width="10%" align="center">&nbsp;</th>
					<th width="5%" align="center">&nbsp;</th>
					<th width="5%" align="center">&nbsp;</th>
					<th width="20%" align="center">&nbsp;</th>
				  </tr>
				  <?php unset($this->_sections['gameRow']);
$this->_sections['gameRow']['name'] = 'gameRow';
$this->_sections['gameRow']['loop'] = is_array($_loop=$this->_tpl_vars['CoachgameArr']) ? count($_loop) : max(0, (int)$_loop); unset($_loop);
$this->_sections['gameRow']['show'] = true;
$this->_sections['gameRow']['max'] = $this->_sections['gameRow']['loop'];
$this->_sections['gameRow']['step'] = 1;
$this->_sections['gameRow']['start'] = $this->_sections['gameRow']['step'] > 0 ? 0 : $this->_sections['gameRow']['loop']-1;
if ($this->_sections['gameRow']['show']) {
    $this->_sections['gameRow']['total'] = $this->_sections['gameRow']['loop'];
    if ($this->_sections['gameRow']['total'] == 0)
        $this->_sections['gameRow']['show'] = false;
} else
    $this->_sections['gameRow']['total'] = 0;
if ($this->_sections['gameRow']['show']):

            for ($this->_sections['gameRow']['index'] = $this->_sections['gameRow']['start'], $this->_sections['gameRow']['iteration'] = 1;
                 $this->_sections['gameRow']['iteration'] <= $this->_sections['gameRow']['total'];
                 $this->_sections['gameRow']['index'] += $this->_sections['gameRow']['step'], $this->_sections['gameRow']['iteration']++):
$this->_sections['gameRow']['rownum'] = $this->_sections['gameRow']['iteration'];
$this->_sections['gameRow']['index_prev'] = $this->_sections['gameRow']['index'] - $this->_sections['gameRow']['step'];
$this->_sections['gameRow']['index_next'] = $this->_sections['gameRow']['index'] + $this->_sections['gameRow']['step'];
$this->_sections['gameRow']['first']      = ($this->_sections['gameRow']['iteration'] == 1);
$this->_sections['gameRow']['last']       = ($this->_sections['gameRow']['iteration'] == $this->_sections['gameRow']['total']);
?>	  				
				  <tr>
				  	<td width="10%" align="left"><?php echo $this->_tpl_vars['CoachgameArr'][$this->_sections['gameRow']['index']]['lesson_title']; ?>
</td>
					<td width="40%" align="left"><?php echo ((is_array($_tmp=$this->_tpl_vars['CoachgameArr'][$this->_sections['gameRow']['index']]['lesson_description'])) ? $this->_run_mod_handler('truncate', true, $_tmp, 130, "...") : smarty_modifier_truncate($_tmp, 130, "...")); ?>
</td>
				  	<td width="10%" align="left"><?php if ($this->_tpl_vars['CoachgameArr'][$this->_sections['gameRow']['index']]['coach_name'] != ''):  echo $this->_tpl_vars['CoachgameArr'][$this->_sections['gameRow']['index']]['coach_name'];  else: ?>N/A<?php endif; ?></td>
					<td width="10%" align="center"><?php if ($this->_tpl_vars['CoachgameArr'][$this->_sections['gameRow']['index']]['lesson_price']): ?>$<?php echo $this->_tpl_vars['CoachgameArr'][$this->_sections['gameRow']['index']]['lesson_price'];  else: ?>N/A<?php endif; ?></td>
					<td width="5%" align="center"><?php if ($this->_tpl_vars['CoachgameArr'][$this->_sections['gameRow']['index']]['lesson_status']):  echo $this->_tpl_vars['CoachgameArr'][$this->_sections['gameRow']['index']]['lesson_status'];  else: ?>N/A<?php endif; ?></td>
					<td width="5%" align="center"><?php if ($this->_tpl_vars['CoachgameArr'][$this->_sections['gameRow']['index']]['date_added'] != '0000-00-00'):  echo ((is_array($_tmp=$this->_tpl_vars['CoachgameArr'][$this->_sections['gameRow']['index']]['date_added'])) ? $this->_run_mod_handler('date_format', true, $_tmp, "%D") : smarty_modifier_date_format($_tmp, "%D"));  else: ?>N/A<?php endif; ?></td>
					<td width="20%" align="center">
						<table>
							<tr>
								<td>
								
								<?php if ($this->_tpl_vars['CoachgameArr'][$this->_sections['gameRow']['index']]['lesson_status_id'] == '1'): ?>
								<div class="view"><a href="#" onclick="ChangeStatus('<?php echo $this->_tpl_vars['CoachgameArr'][$this->_sections['gameRow']['index']]['lesson_id']; ?>
')">
								Pay</a></div>
								<?php elseif ($this->_tpl_vars['CoachgameArr'][$this->_sections['gameRow']['index']]['lesson_status_id'] != '3' && $this->_tpl_vars['CoachgameArr'][$this->_sections['gameRow']['index']]['lesson_status_id'] != '4' && $this->_tpl_vars['CoachgameArr'][$this->_sections['gameRow']['index']]['lesson_status_id'] != '5'): ?>
								<div class="view-a"><a href="#" onclick="LessonComplete('<?php echo $this->_tpl_vars['CoachgameArr'][$this->_sections['gameRow']['index']]['lesson_id']; ?>
')">
								Lesson Completed</a></div>
								<?php else: ?>
								<?php endif; ?>
								</td>
								<td>
								<div class="view" style="margin-right:5px;"><a href="check_lesson_update.php?lesson_id=<?php echo $this->_tpl_vars['CoachgameArr'][$this->_sections['gameRow']['index']]['lesson_id']; ?>
">View</a></div>
								</td>
							</tr>
						</table>
					</td>
				  </tr>
	  			  <?php endfor; endif; ?> 
				<?php else: ?>
				  <tr>
                    <td colspan="6"><center><strong>No Record Exists</strong></center></td>
                  </tr>		
				<?php endif; ?>                                
                </table>
            </div>
        	<div class="clear"></div>
            
        </div>
    </div>
</div>
<iframe width=132 height=142 name="gToday:contrast:agenda.js" id="gToday:contrast:agenda.js" src="DateRange/ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; left:-300px; top:0px;"></iframe>